<%-- 
    Document   : AdminQuestion
    Created on : Nov 23, 2012, 4:03:33 AM
    Author     : KaiLee
--%>


<%@page import="bean_Admin_Product.connectSQLQuestion"%>
<%@page import="beanQuestion.QuestionBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="bean.connectSQL"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<%
    connectSQLQuestion conn = new connectSQLQuestion();
    ArrayList<QuestionBean> list = conn.getQuestion();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Quản lí câu hỏi của khách hàng</title>
        <meta name="keywords" content="baby's day shop" />
        <meta name="description" content="Baby's day" />
        <link href="css/index_style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        <%
            if (session.getValue("username") == null) {
                response.sendRedirect("admin.jsp");
            }
        %>
        <div id="baby_wrapper_outter">

            <div id="baby_wrapper_inner">
                <jsp:include page="headerAdmin.jsp"/>
                <div id="baby_content_wrapper">
                    <jsp:include page="menuLeftAdmin.jsp"/>

                    <div id="baby_content">



                        <form action="DeleteQuestionServlet">

                            <table width="100%" border="1">


                                <tr><h2> Danh sách câu hỏi </h2></tr>
                                <tr>
                                <div>
                                    <td width="10%"><h3>Mã câu hỏi</h3></td>
                                    <td width="20%"><h3>Email</h3></td>
                                    <td width="20%"><h3>Tên<h3></td>
                                                <td width="30%"><h3>Câu hỏi<h3></td>
                                                            <td width="10%"><h3>Xoá<h3></td>
                                                                        <td width="10%"><h3>Xem nội dung<h3></td>





                                                                                    <%



                                                                                        int fID;
                                                                                        String fEmail = null;
                                                                                        String fName = null;
                                                                                        String fQuestion = null;


                                                                                        int i = 0;
                                                                                        if (list.size() > 0) {
                                                                                            while (i < list.size()) {
                                                                                                fID = list.get(i).getId();
                                                                                                fEmail = list.get(i).getEmail();
                                                                                                fName = list.get(i).getName();
                                                                                                fQuestion = list.get(i).getQuestion();


                                                                                    %>

                                                                                    <tr>
                                                                                    <td><%= fID%></td>
                                                                                    <td><%= fEmail%></td>
                                                                                    <td><%= fName%></td>
                                                                                    <td><%= fQuestion%></td>

                                                                                    <td width="3%">

                                                                                    <label>
                                                                                        <!-- Tao 1 checkbox de luu gia tri cua Product id trong form  --> 
                                                                                        <input type="checkbox" name="chon" value="<%=fID%>">
                                                                                    </label>
                                                                                    </td>
                                                                                    <td width="9%"><a href="DeleteQuestion?fID=<%=fID%>" >Delete One </a></td>
                                                                                    <td width="8%"><a href="UpdateServlet?fID=<%=fID%>">Xem</a></td>
                                                                                    </tr>
                                                                                    <%
                                                                                                i++;
                                                                                            }
                                                                                        }
                                                                                    %>
                                                                                    </tr>
                                                                                    </table>   
                                                                                    <input type="submit" value="Xoá nhiều" />
                                                                                    </form>







                                                                                    </div>

                                                                                    <div class="cleaner"></div>

                                                                                    </div>

                                                                                    <jsp:include page="footerAdmin.jsp"/>
                                                                                    </div> 

                                                                                    </div>

                                                                                    </body>
                                                                                    </html>
